<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%-- <%@ page import="java.util.*" %> --%>
<%-- <%@ page import="edu.ucsd.cse135.gas.bean.*" %> --%>

<jsp:useBean id="userBean" class="edu.ucsd.cse135.gas.bean.UserBean" scope="request"/>
<jsp:useBean id="reviewers" class="java.util.ArrayList" scope="request"/>

<tiles:insert page="/general/templateLoggedIn.jsp">
	<tiles:put name="title" value="Chairs Area"/>
	<tiles:put name="nav"/>
	<tiles:put name="content" type="string">

		<h2>Chairs Overview</h2>
		<br>
		<h4>Start Review Process</h4>
		
		To start the review process click on the button bellow!<br><br>
		
		<html:form action="/startReviewProcess">
			<html:hidden property="startReviewProcess" value="true"/>
			<html:submit value="Start Review Process"/>
		</html:form>
		<br>
		<hr>
		<br>
		<h4>Add Reviewer</h4>
		
		<html:form action="/addReviewer" focus="mail">
			<table>
				<tr>
					<td>Mail:</td>
					<td><html:text property="mail"/></td>
				</tr>
				<tr>	
					<td>Password:</td>
					<td><html:password property="password"/></td>
				</tr>
				<tr>
					<td>Confirm Password:</td>
					<td><html:password property="password2"/></td>
				</tr>
				<tr>
					<td colspan="2"><html:submit value="Add"/>
				</tr>
			</table>	
		</html:form>
	<br>
	<hr>
	<br>
	<h4>Reviewers</h4>
	 
	<logic:present name="reviewers" parameter="reviewers" scope="request">
		<table>
			<tr><th>Mail</th><th>Option</th></tr>
			<c:forEach var="reviewer" items="${requestScope.reviewers}">
				 <tr>
				 	<td>
				 		<c:out value="${reviewer.mail}" />
				 	</td>
				 	<td>
				 		<html:form action="/deleteReviewer">
				 			<html:hidden property="reviewer" value="${reviewer.mail}" />
				 			<html:image src="res/img/delete-user.png"/>
				 		</html:form>
				 	</td>
				 </tr>
			</c:forEach>
		</table>
	</logic:present> 
	
	<logic:notPresent name="reviewers" parameter="reviewers" scope="request">
		There are no Reviewers at the moment.
	</logic:notPresent>
		
	</tiles:put>
</tiles:insert>	